import {
  action,
  observable
} from "mobx-miniprogram";

export const userStore = observable({
  // 定义仓库模型
  token: wx.getStorageSync('token') || '',

  get getToken() {
    return this.token
  },


  // 定义方法
  setToken: action(function (payload) {
    this.token = payload;
    wx.setStorageSync('token', this.token)
  })
})